package cn.tedu.zhyl.wx.controller;

import cn.tedu.zhyl.base.response.JsonResult;
import cn.tedu.zhyl.wx.pojo.dto.UserLoginRequestDTO;
import cn.tedu.zhyl.wx.pojo.vo.UserLoginVo;
import cn.tedu.zhyl.wx.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/customer/user")
public class CustomerController {

    @Autowired
    private MemberService memberService;

    @PostMapping("/login")
    public JsonResult<UserLoginVo> login(@RequestBody UserLoginRequestDTO dto){
        UserLoginVo userLoginVo = memberService.login(dto);
        return JsonResult.ok(userLoginVo);
    }
}
